#include <iostream>
#include <string>

using namespace std;
//类模版 ==着重强调是模板
template <class NmaeType, class IdType = int>
class Student
{
	/*****************************方法**************************/
public:
	Student(NmaeType name, IdType id);
	~Student();
	void show();// 显示
/*****************************属性**************************/
public:
	NmaeType name;  //名字
	IdType id;      //ID
};
//类内声明，类外定义======有参构造
template <class NmaeType, class IdType>
//<NmaeType, IdType>
Student<NmaeType, IdType>::Student::Student(NmaeType name, IdType id)
{
	this->id = id;
	this->name = name;
}
template <class NmaeType, class IdType>
Student<NmaeType, IdType>::Student::~Student()
{
}
template <class NmaeType, class IdType>
void Student<NmaeType, IdType>::show()
{
	cout << "name = " << name << " id = " << id << endl;
}

int main(int argc, char const *argv[])
{
   //显示的指定数据类型后====变成模板类====着重强调是类
	Student<string, int> s("张三", 10);
	s.show();
	return 0;
}
